package com.tr.rentcar.controller.houtai.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tr.rentcar.model.dao.AdminroleDao;
@WebServlet("/adminroledelete")
public class AdminroledeleteControllor extends HttpServlet {
	AdminroleDao AdminroleDao=new AdminroleDao();
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		try {
			
		String array=req.getParameter("array");
		String b[]=array.trim().split(" ");
		for (int i = 0 ; i <b.length ; i++ ) {
				if(AdminroleDao.deleterole(Integer.parseInt(b[i]))){
				}
			
		}}  catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			};
			/*System.out.println(a[i]);*/
			resp.sendRedirect(req.getContextPath()+"/houtaiadminrole");
	}
}
